#include "ray.h"
#include "vector.h"

// =================================================================================================
// Get the head of the ray
// =================================================================================================
Vector4 CRay::GetHead() {
    if(dirty)
        CalculatePoint();

    return head;
}

// =================================================================================================
// Compute the head of the ray
// =================================================================================================
void CRay::CalculatePoint() {
    head.x = (mag * direction.x) + origin.x;
    head.y = (mag * direction.y) + origin.y;
    head.z = (mag * direction.z) + origin.z;
}
